![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@techor/pack
Advanced tools
.d.ts
type declarationspackage.json
dependencies
and peerDependencies
by package.json
npm i @techor/pack
techor pack [entryPaths...]
techor-pack [entryPaths...]
Check out the available options here for now
techor pack
analyzes the package.json
entry point relative to input sources in the src
directory for builds.
.
├── package.json
└── packages
└─── a
├─── src
│ ├─── index.ts
│ └─── index.browser.ts
+ ├─── dist
+ │ ├─── index.js
+ │ ├─── index.mjs
+ │ ├─── index.d.ts
+ │ └─── index.browser.ts
└─── package.json
Simultaneously output cjs
, esm
, iife
, type declarations
respectively according to main
, module
, browser
, types
of package.json
{
"name": "a",
"scripts": {
"build": "ts-node ../techor/src/bin pack",
"dev": "pnpm run build --watch"
},
"main": "dist/index.js",
"browser": "dist/index.browser.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"jsnext:main": "dist/index.js",
"esnext": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
]
}
If you only want to pack specific javascript modules, remove the corresponding entry point from package.json
.
Run with the above configuration:
pnpm run build
Now import the above package a
in your project or publish it.
import 'a'
.
├── package.json
└── packages
└─── b
├─── src
│ └─── index.css
+ ├─── dist
+ │ └─── index.css
└─── package.json
Packaging CSS is more straightforward, configuring style
and main
entry points in package.json
.
{
"name": "b",
"scripts": {
"build": "ts-node ../techor/src/bin pack",
"dev": "pnpm run build --watch"
},
"main": "./dist/index.css",
"style": "./dist/index.css",
"files": [
"dist"
]
}
Run with the above configuration:
pnpm run build
Now import the above package b
in your project or publish it.
@import 'b'
techor pack <entryPaths...>
supports glob patterns that let you specify multiple entry points at once, including the output of nested directories.
Specifying an entry point will cause the JavaScript output format
to be preset to cjs,esm
.
techor src/**/*.ts
.
├── package.json
└── packages
└─── a
├─── src
│ ├─── index.ts
│ └─── utils
│ └─── exec.ts
+ ├─── dist
+ │ ├─── index.js
+ │ ├─── index.mjs
+ │ └─── utils
+ │ ├─── exec.cjs
+ │ └─── exec.mjs
└─── package.json
The same goes for multiple CSS entries:
techor src/**/*.css
.
├── package.json
└── packages
└─── a
├─── src
│ ├─── index.css
│ └─── components
│ ├─── card.css
│ └─── button.css
+ ├─── dist
+ │ ├─── index.css
+ │ └─── components
+ │ ├─── card.css
+ │ └─── button.css
└─── package.json
Usually, it would be best to bundle CSS packages through a main index.css
and output other CSS files so developers can import on demand instead of the whole package. For example @master/keyframes.css
techor pack
automatically excludes external dependencies to be bundled by the .dependencies
and peerDependencies
of package.json
src/index.ts
import '@master/css'
import '@master/css.webpack'
import '@master/style-element.react'
package.json
{
"name": "externals",
"main": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.js"
}
},
"files": [
"dist"
],
"dependencies": {
"@master/css": "^2.0.0-beta.55"
},
"peerDependencies": {
"@master/style-element.react": "^2.0.0-beta.7"
},
"devDependencies": {
"@master/css.webpack": "^2.0.0-beta.55"
}
}
Run with the above setup:
techor pack --platform node
@master/css.webpack
is bundled into dist/index.js
, except for @master/css
and @master/style-element.react
.
So if there is an external package that needs to be bundled, you just install it to devDependencies
via npm i <some-package> --save-dev
, then techor pack
will not exclude it.
techor pack
defaults to pack multiple outputs with different formats and platforms according to exports
bin
in package.json
.
.
├── package.json
└── packages
└─── a
├─── src
│ ├─── index.ts
│ └─── utils
│ └─── exec.ts
+ ├─── dist
+ │ ├─── index.js
+ │ ├─── index.mjs
+ │ └─── utils
+ │ ├─── exec.cjs
+ │ └─── exec.mjs
└─── package.json
package.json
{
"name": "externals",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.js"
},
"./utils/exec": {
"require": "./dist/utils/exec.cjs",
"import": "./dist/utils/exec.mjs"
}
}
}
Any nested conditions in exports
like node
, browser
, default
, require
, and import
will be mapped to ESBuild’s format
and platform
options.
mangleProps
techor pack --mangle-props '^_'
- module.exports._parse = parse;
- module.exports._enoent = enoent;
+ module.exports.b = parse;
+ module.exports.c = enoent;
FAQs
Bundling your TypeScript and CSS packages with zero configuration
We found that @techor/pack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.